class Watcher {
  constructor(vm, key, callback) {
    this.vm = vm
    this.key = key
    this.callback = callback
    // 将当前watcher实例只当到dep静态实例target上
    Dep.target = this
    this.vm[this.key] // 触发getter，添加依赖
    Dep.target = null
  }
  update() {
    // console.log('属性更新了')
    this.callback(this.vm[this.key])
  }
}